|
That code will not work in VB6. You'll need to use VB.NET to use that code. You can get the Express Edition for free from here[^].
|
|
|
|
|
I have to writen the XML file in VB 6.0
<Globus xmlns:xsi = 'http://www.w3.org/2001/XMLSchema-instance'
xmlns = 'http://www.temenos.com/GLOBUS/OFSML/120'
xsi:schemaLocation = 'http://www.temenos.com/GLOBUS/OFSML/120 ../../xsd/ofsml.xsd'>
<ofsmlHeader xsi:nil="true" />
<serviceRequest >
<securityContext>
<userName>INPUTT</userName>
<password>123456</password>
<company>VN0010001</company>
</securityContext>
<ofsStandardEnquiry name = 'ACCOUNT-IBS'>
<selectionCriteria operand = "EQ">
<fieldName>ACCOUNT.NUMBER</fieldName>
<value>002100000415<</value>
</selectionCriteria>
</ofsStandardEnquiry>
</serviceRequest>
</Globus>
So i have written as
Dim objDOM As New MSXML2.DOMDocument30
Dim objnode As MSXML2.IXMLDOMNode
Dim objChildNode As MSXML2.IXMLDOMNode
Dim ObjServicereq As MSXML2.IXMLDOMNode
Dim objserviceCon As MSXML2.IXMLDOMNode
Dim ofsStandardEnquiry As MSXML2.IXMLDOMNode
Dim objattribute As MSXML2.IXMLDOMAttribute
Dim objattribute1 As MSXML2.IXMLDOMAttribute
Dim objattribute2 As MSXML2.IXMLDOMAttribute
Dim objelement As MSXML2.IXMLDOMElement
Dim objelement1 As MSXML2.IXMLDOMElement
Dim objattribute3 As MSXML2.IXMLDOMAttribute
Dim objattribute4 As MSXML2.IXMLDOMAttribute
Dim objattribute5 As MSXML2.IXMLDOMAttribute
' Set objNode = objDOM.createNode(NODE_PROCESSING_INSTRUCTION, "xml", "")
' objDOM.appendChild objNode
'
Set objnode = objDOM.createNode(NODE_ELEMENT, "GLOBUS", "")
Set objelement = objnode
'
Set objattribute = objDOM.createAttribute("xmlns:xsi")
objattribute.Text = "http://www.w3.org/2001/XMLSchema-instance"
objelement.setAttributeNode objattribute
'
Set objattribute1 = objDOM.createAttribute("xmlns")
objattribute1.Text = "http://www.temenos.com/GLOBUS/OFSML/120"
objelement.setAttributeNode objattribute1
Set objattribute2 = objDOM.createAttribute("xsi:schemaLocation")
objattribute2.Text = "http://www.temenos.com/GLOBUS/OFSML/120 ../../xsd/ofsml.xsd"
objelement.setAttributeNode objattribute2
'
Set objattribute = Nothing
Set objattribute1 = Nothing
Set objattribute2 = Nothing
Set objChildNode = objDOM.createNode(NODE_ELEMENT, "ofsmlHeader", "")
Set objattribute3 = objDOM.createAttribute("xsi:nil")
objattribute3.Text = "true"
Set objelement1 = objChildNode
objnode.appendChild objChildNode
objelement1.setAttributeNode objattribute3
Set objelement1 = Nothing
Set ObjServicereq = objDOM.createNode(NODE_ELEMENT, "serviceRequest", "")
objChildNode.appendChild ObjServicereq
Set objserviceCon = objDOM.createNode(NODE_ELEMENT, "securityContext", "")
Dim xmlElmName As MSXML2.IXMLDOMElement
Set xmlElmName = objDOM.createElement("userName")
objserviceCon.appendChild xmlElmName
xmlElmName.Text = "INPUTT"
Dim xmlElmPASSWORD As MSXML2.IXMLDOMElement
Set xmlElmPASSWORD = objDOM.createElement("password")
objserviceCon.appendChild xmlElmPASSWORD
xmlElmPASSWORD.Text = "123456"
Dim xmlElmcompany As MSXML2.IXMLDOMElement
Set xmlElmcompany = objDOM.createElement("company")
objserviceCon.appendChild xmlElmcompany
xmlElmcompany.Text = "VN0010001"
objnode.appendChild ObjServicereq
ObjServicereq.appendChild objserviceCon
Set objserviceCon = Nothing
Set ofsStandardEnquiry = objDOM.createNode(NODE_ELEMENT, "ofsStandardEnquiry", "")
Set objattribute4 = objDOM.createAttribute("NAME")
objattribute4.Text = "ACCOUNT-IBS"
Set objelement = ofsStandardEnquiry
objnode.appendChild ofsStandardEnquiry
objelement.setAttributeNode objattribute4
ObjServicereq.appendChild ofsStandardEnquiry
Dim objselectioncriteria As MSXML2.IXMLDOMNode
Set objselectioncriteria = objDOM.createNode(NODE_ELEMENT, "selectionCriteria", "")
Set objattribute5 = objDOM.createAttribute("Operand")
objattribute5.Text = "EQ"
Set objelement = objselectioncriteria
ObjServicereq.appendChild objselectioncriteria
objelement.setAttributeNode objattribute5
Set objelement = Nothing
Dim xmlElmfieldName As MSXML2.IXMLDOMElement
Set xmlElmfieldName = objDOM.createElement("fieldName")
objselectioncriteria.appendChild xmlElmfieldName
xmlElmfieldName.Text = "CUSTOMER.CODE"
Dim xmlElmvalue As MSXML2.IXMLDOMElement
Set xmlElmvalue = objDOM.createElement("value")
objselectioncriteria.appendChild xmlElmvalue
xmlElmvalue.Text = "100297"
objnode.appendChild ObjServicereq
objDOM.appendChild objnode
Set objelement = Nothing
Set objChildNode = Nothing
Set objselectioncriteria = Nothing
Set ofsStandardEnquiry = Nothing
Set ObjServicereq = Nothing
Set objnode = Nothing
MsgBox objDOM.xml
objDOM.save ("C:\SCBDATA\Request\Request_ACC.XML")
Debug.Print objDOM.xml
Set objDOM = Nothing
' Call GENCUST
End Sub
but i get output as
<Globus xmlns:xsi = 'http://www.w3.org/2001/XMLSchema-instance'
xmlns = 'http://www.temenos.com/GLOBUS/OFSML/120'
xsi:schemaLocation = 'http://www.temenos.com/GLOBUS/OFSML/120 ../../xsd/ofsml.xsd'>;
<ofsmlHeader xmlns = "" xsi:nil="true" />;
<serviceRequest xmlns = "" >
<securityContext>
<userName>INPUTT</userName>
<password>123456</password>;
<company>VN0010001</company>;
</securityContext>;
<ofsStandardEnquiry name = 'ACCOUNT-IBS'>
<selectionCriteria operand = "EQ">
<fieldName>ACCOUNT.NUMBER<</fieldName>
<value>002100000415</value>
</selectionCriteria>
</ofsStandardEnquiry>
</serviceRequest>
</Globus>
xmlns = "" is repeating at ofsmlheaser and service request ,.. please help me like how to write it by getting it correctly .
So please suggest me any way in VB 6.o to make the xmlns="" no get repeated for child nodes ...
|
|
|
|
|
Member 6161367 wrote: in VB 6.o
VB6 had terrible XML support, which follows, because it was a terrible joke of a language. Why are you using it ?
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
hi christian,
I was given this task in vb 6.0 only,So i suggest any one to tell me like what can be apossible way to stop that xmlns="" not to get repeated in other child nodes ..
Can u please suggest me some way .As we r forced to genearte a n XML file in vb 6.0 we require ur help in thsi context ...
Thanks,
Pallavi.
|
|
|
|
|
Hello Experts.
I am try to create Employee Payroll in Excel Sheet using VB.Net.
using Excel.Application, Excel.Workbook, Excel.Worksheet insert data and formatting data.
After the save this Excel Workbook.
I try to display this excel sheet in VB.NET Form.
Now my problem is I m using Web browser it is working properly.
But When i open this program other excel Book(Opened Book) is not working in Excel 2003/ not displaying and I can't open new Excel sheet using Excel 2003 Until closing my Programming.
Please Help me.
Thanks in advance.
|
|
|
|
|
I want to write an application to read data from a specific IP address and Port. I have been searching for solutions on internet and understand that I need to use TCPlistener.
- My PC will act as server or client? does it matter when i write the application?
- how can I test my Tcplistener application? I would like to send data to a port and read it using my application and send data back. Please let me know if i need to edit any setting on router as well.
thanks
chun
|
|
|
|
|
Chun2 wrote: I want to write an application to read data from a specific IP address and Port
Are you says that you want to monitor the traffic going to/from that IP?? Is that IP on your machine or another, remote, machine??
|
|
|
|
|
hello everyone,
I would like to know how can i read the IP address!can anyone help me?
Thank you !
|
|
|
|
|
Start
run
cmd.exe
ipconfig
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
You not help me!in vb i mean!
|
|
|
|
|
|
|
You can use VB.Net class to get the local IP or by using Winsock Object
I don't know if they are both the same (Winsock is included in vb.net class)
#1
Dim _WinSock As Object
Dim _LocalIP As String
_WinSock = CreateObject("mswinsock.winsock")
_LocalIP = Trim(_WinSock.LocalIP)
Debug.print(_LocalIP)
#2
Dim _HostName = System.Net.Dns.GetHostName()
Dim _IPAdress = System.Net.Dns.GetHostAddresses(_HostName)(0).ToString
Debug.Print(_IPAdress)
Like car accidents, most hardware problems are due to driver error.
Samir R. Ibrahim
|
|
|
|
|
Hi,
your computer does not know what its public IP address is, since that depends on how you connect to the internet; intervening devices (your DSL modem, your provider, ..) can alter your public IP address. The only way to get it, is by getting it returned from some web site.
I have a page that does exactly that: http://www.perceler.com/getipadr1.php[^]. Send a WebRequest for it, and get the Response.
|
|
|
|
|
Nice Site
And here is the code to do it.
Dim _xmlHTTP
Dim _URL As String
_xmlHTTP = CreateObject("MSXML2.XMLHTTP")
_URL = "http://www.perceler.com/getipadr1.php"
_xmlHTTP.Open("GET", _URL, False)
_xmlHTTP.Send()
Debug.Print(_xmlHTTP.responseText)
Is that what you mean by WebRequest ?
I am asking to learn more feature. Thanks.
Like car accidents, most hardware problems are due to driver error.
Samir R. Ibrahim
|
|
|
|
|
|
Hi Luc,
Almost all my example depends on object (WMI or CreateObject) which I used to use in VFP, So that i am trying to find VB.Net Pure code.
Thanks for the link, Very Usefull
Like car accidents, most hardware problems are due to driver error.
Samir R. Ibrahim
|
|
|
|
|
Hi again,
I have added example code to my web page on getipadr1[^].
It is C# code, but the same can be done in VB.NET (VB.NET has a Using...End Using block, similar to C#'s using statement).
|
|
|
|
|
Much better than the Link microsoft you post.
Here is the vb.net version of your code.
Dim url = "http://www.perceler.com/getipadr1.php"
Dim req As HttpWebRequest = WebRequest.Create(url)
Dim resp As WebResponse = req.GetResponse()
Dim stream As Stream = resp.GetResponseStream()
Dim reader As New StreamReader(stream)
Debug.Print(reader.ReadToEnd)
Like car accidents, most hardware problems are due to driver error.
Samir R. Ibrahim
|
|
|
|
|
OK.
However you should call Close or use a Using...EndUsing construct to clean up the WebResponse, Stream and StreamReader.
|
|
|
|
|
i have a dataset consisting of 3 tables table 1 is for insert , 2 for update and 3 for delete. if row one from table 1 is inserted only then row one from table 2 should be updated and so is with table 3. if any operation fails then all the data of row one from all three table should not happen. then they should move to next row.
one way is i use a for loop and apply transaction to the command and use logic for update and delete transaction.
but is there a way in .net where i can use transaction to a datatable and sync insert , update and delete operation between 3 tables.
|
|
|
|
|
nitin_ion wrote: but is there a way in .net where i can use transaction to a datatable and sync insert , update and delete operation between 3 tables.
Not that I know of. Your design sounds like a horror.
You could move the processing into a stored procedure but it would still be 3 operations wrapped in a transaction.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
I am beginner in Visual Basic and i am using Visual Basic 2008 Express. I would like to do the following from a Visual Basic progrma:
a) Create a Microsoft Access Table with primary key and columns (Name, Address, Country, Tel No)
b) Insert records into the Access Table, after getting user input for Name, Address, Country and Tel No via textboxes
Can anyone kindly advise me some sample codes using the OleDBCommand? I tried to googling around but i'm stuck with creating the Access table with primary key.
Thank you very much for your kind help.
Regards,
|
|
|
|
|
If you download the VS2008 Samples[^], you will find examples of how to do this sort of thing in the Data Samples directory.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi to all,
Can we disable the right click of the mouse, (so that when my application runs teh user cannot do right click on the task bar and ends the process of my application)
thanks
|
|
|
|